import java.util.Arrays;
import java.util.Scanner;

public class Main5 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        Arrays.sort(arr);
        int x = scanner.nextInt();
        int i = 0;
        for (; i < n; i++) {
            if (arr[i] == x) {
                System.out.println(i + 1);
                break;
            }
        }
        if (i == n) {
            System.out.println(-1);
        }
    }
}
